From: Stuart Hayhurst Date: Sun, 27 Aug 2023 18:25:42 +0000 (+0100) Subject: osdWindow: Allow label and level to be null X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~320^2^2~44 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=215282a320ca8f2b44b950191bed193db2fe4f0c;p=gnome-shell.git osdWindow: Allow label and level to be null Allow passing 'null' to setLevel and setLabel, so 'null' and 'undefined' behave the same way. Fixes a regression introduced by a42f7c23, which caused parts of old notifications to persist into new notifications, or elements being incorrectly made visible Part-of: --- diff --git a/js/ui/osdWindow.js b/js/ui/osdWindow.js index dcefd44c9..9d32e40cb 100644 --- a/js/ui/osdWindow.js +++ b/js/ui/osdWindow.js @@ -65,15 +65,15 @@ class OsdWindow extends Clutter.Actor { } setLabel(label) { - this._label.visible = label !== undefined; - if (label) + this._label.visible = label != null; + if (this._label.visible) this._label.text = label; this._updateBoxVisibility(); } setLevel(value) { - this._level.visible = value !== undefined; - if (value !== undefined) { + this._level.visible = value != null; + if (this._level.visible) { if (this.visible) { this._level.ease_property('value', value, { mode: Clutter.AnimationMode.EASE_OUT_QUAD,